Interface to a solve system of nonlinear equations in parallel. More...
#include <nonlinear_solver_interface.hpp>
Public Types | |
typedef VectorT< T, I > | VectorType |
typedef MatrixT< T, I > | MatrixType |
Public Member Functions | |
NonlinearSolverInterface () | |
Default constructor. | |
virtual | ~NonlinearSolverInterface (void) |
Destructor. | |
double | tolerance (void) const |
Get the solution tolerance. | |
void | tolerance (const double &tol) |
Set the solver tolerance. | |
int | maximumIterations (void) const |
Get the maximum iterations. | |
void | maximumIterations (const int &n) |
Set the maximum solution iterations. | |
void | solve (VectorType &x) |
Solve w/ the specified initial estimated, put result in same vector. |
Interface to a solve system of nonlinear equations in parallel.
This serves as a base for classes that solve a system of nonlinear equations. While not strictly abstract, it has no function if instantiated on its own.
It encapuslates the nonlinear system solver of some underlying implementation. The Pimpl idiom is used for implementation, so user code is completely independent of the underlying library. This class simply provides an interface to a specific implementation. Subclasses are required to call p_set_impl() at construction to set the implementation.
typedef MatrixT<T, I> gridpack::math::NonlinearSolverInterface< T, I >::MatrixType |
typedef VectorT<T, I> gridpack::math::NonlinearSolverInterface< T, I >::VectorType |
gridpack::math::NonlinearSolverInterface< T, I >::NonlinearSolverInterface | ( | ) |
Default constructor.
virtual gridpack::math::NonlinearSolverInterface< T, I >::~NonlinearSolverInterface | ( | void | ) | [virtual] |
Destructor.
void gridpack::math::NonlinearSolverInterface< T, I >::maximumIterations | ( | const int & | n | ) |
Set the maximum solution iterations.
n | new maximum number of iterations |
int gridpack::math::NonlinearSolverInterface< T, I >::maximumIterations | ( | void | ) | const |
Get the maximum iterations.
void gridpack::math::NonlinearSolverInterface< T, I >::solve | ( | VectorType & | x | ) |
Solve w/ the specified initial estimated, put result in same vector.
This solves the system of nonlinear equations using the contents of x
as an initial solution estimate. The final result is placed back in x
upon completion.
x | solution Vector |
void gridpack::math::NonlinearSolverInterface< T, I >::tolerance | ( | const double & | tol | ) |
Set the solver tolerance.
tol | new solution tolerance |
double gridpack::math::NonlinearSolverInterface< T, I >::tolerance | ( | void | ) | const |
Get the solution tolerance.